package com.hmkj.admin.controller.log;

import com.hmkj.admin.controller.BaseController;
import com.hmkj.admin.controller.GenericController;
import com.hmkj.common.entity.dtgrid.DtGrid;
import com.hmkj.core.constant.Constants;
import com.hmkj.core.model.log.NoticeLogModel;
import com.hmkj.core.po.system.NoticeLog;
import com.hmkj.core.service.system.NoticeLogService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping(BaseController.BASE_URI)
public class NoticeLogJsonController extends GenericController<Integer,NoticeLog> {
    @Resource
    private NoticeLogService noticeLogService;


    /**
     * 通知记录列表json数据
     */
    @ResponseBody
    @RequestMapping("noticeLog/json/list")
    @RequiresPermissions("sys:noticeLog:list")
    public DtGrid listJson(String dtGridPager) throws Exception {
        DtGrid dtgrid = dataAuthority(dtGridPager, Constants.AG);
        return noticeLogService.getDtGridList(dtgrid,NoticeLogModel.class);
    }

}
